﻿using CeremonyBackground.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace CeremonyBackground.Infrastructure.EntityConfigurations
{
    public class UserPrizeRecordEntityTypeConfiguration
        : IEntityTypeConfiguration<UserPrizeRecord>
    {
        public void Configure(EntityTypeBuilder<UserPrizeRecord> builder)
        {
            builder.ToTable("UserPrizeRecord");

            builder.HasKey(ci => ci.Id);

            builder.Property(ci => ci.Id)
               .UseHiLo("userprizerecord_hilo")
               .IsRequired();

            builder.Property(cb => cb.UserId)
                .IsRequired(true);
            builder.Property(cb => cb.PrizeId)
               .IsRequired(true);
            builder.Property(cb => cb.IsRemove)
               .IsRequired(true);
            builder.Property(cb => cb.CreateTime)
               .IsRequired(true);

        }
    }
}
